package com.dsz.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.dsz.dao.AdminDao;
import com.dsz.po.Admin;
@Service
@Transactional
public class AdminServiceImpl implements AdminService {
	//依赖注入
	@Autowired
	private AdminDao adminDao;
	//查询账号
	@Override
	public Admin findAdmin(String username,String password) {
		Admin admin = adminDao.findAdmin(username, password);
		return admin;
	}
	//修改账号
	@Override
	public int updateAdmin(Admin admin) {
		int rows = adminDao.updateAdmin(admin);
		return rows;
	}
	//通过id查询信息
	@Override
	public Admin findAdminById(Integer id) {
		Admin admin = adminDao.findAdminById(id);
		return admin;
	}

}
